<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title id="title">
        {{titleName}}
    </title>
    <style>
        .active{
            background-color:rgb(99, 177, 245);
            height: 2rem;
            width: 3rem;
            text-align: center;
        }
    </style>
</head>

<body>
    <div id="app">
        <!-- isActive不需要打引号 -->
        <!-- :class相当于 v-bind:class，这是一个语法糖 -->
        <div :class="{ 'active': isActive}">
            要死
        </div>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        let app = new Vue({
            el: '#app',
            data() {
                return {
                    isActive: true
                }
            }
        });

        let app1 = new Vue({
            el:'#title',
            data(){
                return{
                    titleName: '拎包'
                }
            }
        })
    </script>
</body>

</html>